home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 122
/
MOBICLIC 122.ISO
/
mac
/
DATA
/
DSS122
/
DSS122_04
/
DSS122_04.swf
/
scripts
/
frame_110
/
DoAction.as
Wrap
Text File
|
2010-02-18
|
6KB
|
207 lines
function stopGui()
{
_root.GUILLAUMET_JEU.gotoAndStop("E1");
if(countEl == 7)
{
gotoAndStop("FIN_01");
}
}
stop();
if(_global.HOTE.gListeLettres_DSS122[8] == 1)
{
LETTRE_09._visible = 0;
}
if(_global.HOTE.gListeLettres_DSS122[9] == 1)
{
LETTRE_05._visible = 0;
}
var i = 9;
while(i <= 10)
{
this["LETTRE_" + gimme2digits(i)].pLettre = i;
this["LETTRE_" + gimme2digits(i)].onRollOver = function()
{
if(_root.drag == undefined)
{
this.gotoAndStop("E2");
joueBruitage({nomSon:"B_LETTRE"});
gereCursor(3);
}
};
this["LETTRE_" + gimme2digits(i)].onRollOut = function()
{
if(_root.drag == undefined)
{
this.gotoAndStop("E1");
stopBruitage({nomSon:"B_LETTRE"});
gereCursor(1);
}
};
this["LETTRE_" + gimme2digits(i)].onPress = function()
{
if(_root.drag == undefined)
{
stopBruitage({nomSon:"B_LETTRE"});
gereCursor(1);
_root.drag = this.pLettre;
this.origX = this._x;
this.origY = this._y;
this.diffX = _root._xmouse - this._x;
this.diffY = _root._ymouse - this._y;
this.origDepth = this.getDepth();
this.swapDepths(10);
}
};
this["LETTRE_" + gimme2digits(i)].onRelease = this["LETTRE_" + gimme2digits(i)].onReleaseOutside = function()
{
if(_root.drag == this.pLettre)
{
if(this.overSac == 1)
{
joueBruitage({nomSon:"B_SUCCES"});
this._visible = 0;
_global.HOTE.gListeLettres_DSS122[this.pLettre - 1] = 1;
}
else if(this.overGui == 1)
{
joueSon({nomSon:"02_BAD_LETTRE09",actionFin:"stopGui"});
_root.GUILLAUMET_JEU.gotoAndStop("E4");
this._x = this.origX;
this._y = this.origY;
}
else
{
joueBruitage({nomSon:"B_ECHEC"});
this._x = this.origX;
this._y = this.origY;
}
this.swapDepths(this.origDepth);
_root.drag = undefined;
this.gotoAndStop("E1");
}
};
this["LETTRE_" + gimme2digits(i)].onEnterFrame = function()
{
if(_root.drag == this.pLettre)
{
this._x = _root._xmouse - this.diffX;
this._y = _root._ymouse - this.diffY;
if(_root.SAC.hitTest(_root._xmouse,_root._ymouse,1))
{
this.gotoAndStop("E1");
this.overSac = 1;
this.overGui = 0;
}
else if(_root.GUILLAUMET_JEU.hitTest(_root._xmouse,_root._ymouse,1))
{
this.gotoAndStop("E1");
_root.GUILLAUMET_JEU.gotoAndStop("E2");
this.overGui = 1;
this.overSac = 0;
}
else
{
this.gotoAndStop("E2");
_root.GUILLAUMET_JEU.gotoAndStop("E1");
this.overSac = 0;
this.overGui = 0;
}
}
};
i++;
}
countEl = 0;
var i = 1;
while(i <= 15)
{
this["EL_" + gimme2digits(i)].pEl = i;
this["EL_" + gimme2digits(i)].onRollOver = function()
{
if(_root.drag == undefined)
{
this.gotoAndStop("E2");
joueBruitage({nomSon:"B_EL"});
gereCursor(3);
}
};
this["EL_" + gimme2digits(i)].onRollOut = function()
{
if(_root.drag == undefined)
{
this.gotoAndStop("E1");
stopBruitage({nomSon:"B_LETTRE"});
gereCursor(1);
}
};
this["EL_" + gimme2digits(i)].onPress = function()
{
if(_root.drag == undefined)
{
stopBruitage({nomSon:"B_LETTRE"});
gereCursor(1);
_root.drag = this.pEl;
this.origX = this._x;
this.origY = this._y;
this.diffX = _root._xmouse - this._x;
this.diffY = _root._ymouse - this._y;
this.origDepth = this.getDepth();
this.swapDepths(10);
}
};
this["EL_" + gimme2digits(i)].onRelease = this["EL_" + gimme2digits(i)].onReleaseOutside = function()
{
if(_root.drag == this.pEl)
{
if(this.overGui == 1)
{
if(this.pEl <= 7)
{
joueSon({nomSon:"02_OK_" + gimme2digits(this.pEl),actionFin:"stopGui"});
_root.GUILLAUMET_JEU.gotoAndStop("E3");
this._visible = 0;
_root.countEl += 1;
}
else
{
joueSon({nomSon:"02_BAD_" + gimme2digits(this.pEl),actionFin:"stopGui"});
_root.GUILLAUMET_JEU.gotoAndStop("E4");
this._x = this.origX;
this._y = this.origY;
}
}
else
{
joueBruitage({nomSon:"B_ECHEC"});
this._x = this.origX;
this._y = this.origY;
}
this.swapDepths(this.origDepth);
_root.drag = undefined;
this.gotoAndStop("E1");
}
};
this["EL_" + gimme2digits(i)].onEnterFrame = function()
{
if(_root.drag == this.pEl)
{
this._x = _root._xmouse - this.diffX;
this._y = _root._ymouse - this.diffY;
if(_root.GUILLAUMET_JEU.hitTest(_root._xmouse,_root._ymouse,1))
{
this.gotoAndStop("E1");
_root.GUILLAUMET_JEU.gotoAndStop("E2");
this.overGui = 1;
this.overSac = 0;
}
else
{
this.gotoAndStop("E2");
_root.GUILLAUMET_JEU.gotoAndStop("E1");
this.overSac = 0;
this.overGui = 0;
}
}
};
i++;
}